/*
  +----------------------------------------------------------------------+
  | PHP Version 5                                                        |
  +----------------------------------------------------------------------+
  | Copyright (c) 1997-2010 The PHP Group                                |
  +----------------------------------------------------------------------+
  | This source file is subject to version 3.01 of the PHP license,      |
  | that is bundled with this package in the file LICENSE, and is        |
  | available through the world-wide-web at the following url:           |
  | http://www.php.net/license/3_01.txt                                  |
  | If you did not receive a copy of the PHP license and are unable to   |
  | obtain it through the world-wide-web, please send a note to          |
  | license@php.net so we can mail you a copy immediately.               |
  +----------------------------------------------------------------------+
  | Author:                                                              |
  +----------------------------------------------------------------------+
*/

/* $Id: header 297205 2010-03-30 21:09:07Z johannes $ */

#ifndef PHP_STARCORE_H
#define PHP_STARCORE_H

extern zend_module_entry starcore_module_entry;
#define phpext_starcore_ptr &starcore_module_entry

#ifdef PHP_WIN32
#	define PHP_STARCORE_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
#	define PHP_STARCORE_API __attribute__ ((visibility("default")))
#else
#	define PHP_STARCORE_API
#endif

#ifdef ZTS
extern "C"{
#include "TSRM.h"
}
#endif
#include "vsopenapi.h"
extern "C"{
#include "vs_shell.h"
};
#include "vscoreshell.h"

PHP_MINIT_FUNCTION(starcore);
PHP_MSHUTDOWN_FUNCTION(starcore);
PHP_RINIT_FUNCTION(starcore);
PHP_RSHUTDOWN_FUNCTION(starcore);
PHP_MINFO_FUNCTION(starcore);

PHP_FUNCTION(confirm_starcore_compiled);	/* For testing, remove later. */
PHP_FUNCTION(lhm_test);

/* 
  	Declare any global variables you may need between the BEGIN
	and END macros here:     
*/
ZEND_BEGIN_MODULE_GLOBALS(starcore)

ZEND_END_MODULE_GLOBALS(starcore)
/*
*/

/* In every utility function you add that needs to use variables 
   in php_starcore_globals, call TSRMLS_FETCH(); after declaring other 
   variables used by that function, or better yet, pass in TSRMLS_CC
   after the last function argument and declare your utility function
   with TSRMLS_DC after the last declared argument.  Always refer to
   the globals in your function as STARCORE_G(variable).  You are 
   encouraged to rename these macros something shorter, see
   examples in any other php module directory.
*/

#ifdef ZTS
#define STARCORE_G(v) TSRMG(starcore_globals_id, zend_starcore_globals *, v)
#else
#define STARCORE_G(v) (starcore_globals.v)
#endif


/*---------------starcore class define------------------*/
PHP_METHOD(StarCoreClass, __construct);
PHP_METHOD(StarCoreClass, __destruct);
PHP_METHOD(StarCoreClass, __get);
PHP_METHOD(StarCoreClass, __set);
PHP_METHOD(StarCoreClass, __call);
PHP_METHOD(StarCoreClass, __toString);

PHP_METHOD(StarCoreClass, _InitCore);
PHP_METHOD(StarCoreClass, _InitSimple);
PHP_METHOD(StarCoreClass, _InitSimpleEx);
PHP_METHOD(StarCoreClass, _ModuleExit);
PHP_METHOD(StarCoreClass, _Print);

PHP_METHOD(StarCoreClass, _CreateSrvGroup);
PHP_METHOD(StarCoreClass, _DeleteSrvGroup);
PHP_METHOD(StarCoreClass, _SrvGroupInfo);
PHP_METHOD(StarCoreClass, _FirstSrvGroup);
PHP_METHOD(StarCoreClass, _NextSrvGroup);
PHP_METHOD(StarCoreClass, _GetSrvGroup);

PHP_METHOD(StarCoreClass, _GetOsType);
PHP_METHOD(StarCoreClass, _Time);
PHP_METHOD(StarCoreClass, _GetRegStr);
PHP_METHOD(StarCoreClass, _GetRegInt);

PHP_METHOD(StarCoreClass, _shl32);
PHP_METHOD(StarCoreClass, _shr32);
PHP_METHOD(StarCoreClass, _and32);
PHP_METHOD(StarCoreClass, _or32);
PHP_METHOD(StarCoreClass, _xor32);

PHP_METHOD(StarCoreClass, _FindFirstFile);
PHP_METHOD(StarCoreClass, _FindNextFile);
PHP_METHOD(StarCoreClass, _FindClose);

PHP_METHOD(StarCoreClass, _htonl);
PHP_METHOD(StarCoreClass, _htons);
PHP_METHOD(StarCoreClass, _ntohl);
PHP_METHOD(StarCoreClass, _ntohs);

PHP_METHOD(StarCoreClass, _SRPDispatch);
PHP_METHOD(StarCoreClass, _SRPIdle);
PHP_METHOD(StarCoreClass, _MsgLoop);
PHP_METHOD(StarCoreClass, _WinMsgDispatch);
PHP_METHOD(StarCoreClass, _KeyPress);

PHP_METHOD(StarCoreClass, _ShellExecute);
PHP_METHOD(StarCoreClass, _GetKeyState);

PHP_METHOD(StarCoreClass, _IntComp);
PHP_METHOD(StarCoreClass, _UIntComp);

PHP_METHOD(StarCoreClass, _UuidCreate);

PHP_METHOD(StarCoreClass, _GetUrl);
PHP_METHOD(StarCoreClass, _GetRootUrl);

PHP_METHOD(StarCoreClass, _SetProgramType);
PHP_METHOD(StarCoreClass, _GetProgramType);

PHP_METHOD(StarCoreClass, _SetHighPriority);

PHP_METHOD(StarCoreClass, _strchr);
PHP_METHOD(StarCoreClass, _strrchr);

PHP_METHOD(StarCoreClass, _IDToMD5);
PHP_METHOD(StarCoreClass, _GetSysPath);

PHP_METHOD(StarCoreClass, _Version);

/*
    {"_RegMsgCallBack", PythonRegMsgCallBack,METH_VARARGS,""},

	{"_QueryPublicService", PythonQueryPublicService,METH_VARARGS,""},

	{"print", PythonPrint,METH_VARARGS,""},
	{"_captureprint", PythonCapturePrint,METH_VARARGS,""},
*/

/*---------------srvgroup class define------------------*/
PHP_METHOD(SrvGroupClass, __construct);
PHP_METHOD(SrvGroupClass, __destruct);
PHP_METHOD(SrvGroupClass, __get);
PHP_METHOD(SrvGroupClass, __set);
PHP_METHOD(SrvGroupClass, __call);
PHP_METHOD(SrvGroupClass, __toString);

PHP_METHOD(SrvGroupClass, _GetService);
PHP_METHOD(SrvGroupClass, _GetServiceEx);

PHP_METHOD(SrvGroupClass, _Print);

PHP_METHOD(SrvGroupClass, _ID);
PHP_METHOD(SrvGroupClass, _IsServer);
PHP_METHOD(SrvGroupClass, _IsClient);
PHP_METHOD(SrvGroupClass, _IsDebug);
PHP_METHOD(SrvGroupClass, _IsServerClient);

PHP_METHOD(SrvGroupClass, _IsObject);
PHP_METHOD(SrvGroupClass, _IsParaPkg);
PHP_METHOD(SrvGroupClass, _IsQueryRecord);
PHP_METHOD(SrvGroupClass, _IsBinBuf);
PHP_METHOD(SrvGroupClass, _IsSXml);
PHP_METHOD(SrvGroupClass, _IsFunctionPara);
PHP_METHOD(SrvGroupClass, _IsCommInterface);

PHP_METHOD(SrvGroupClass, _TickCount);
PHP_METHOD(SrvGroupClass, _MD5);
PHP_METHOD(SrvGroupClass, _SetDataServerAddr);
PHP_METHOD(SrvGroupClass, _SetServerPara);
PHP_METHOD(SrvGroupClass, _QuyeryStatistic);
PHP_METHOD(SrvGroupClass, _Hash);
PHP_METHOD(SrvGroupClass, _GetModulePath);
PHP_METHOD(SrvGroupClass, _GetServicePath);
PHP_METHOD(SrvGroupClass, _SetServicePath);
PHP_METHOD(SrvGroupClass, _ServicePathIsSet);

PHP_METHOD(SrvGroupClass, _GetCurrentPath);
PHP_METHOD(SrvGroupClass, _SetCurrentPath);

PHP_METHOD(SrvGroupClass, _GetSRPTempPath);
PHP_METHOD(SrvGroupClass, _GetSRPConfigPath);

PHP_METHOD(SrvGroupClass, _IsInSync);
PHP_METHOD(SrvGroupClass, _IsServiceSync);
PHP_METHOD(SrvGroupClass, _WaitServiceSync);

PHP_METHOD(SrvGroupClass, _ImportServiceEx);
PHP_METHOD(SrvGroupClass, _ImportServiceWithPath);
PHP_METHOD(SrvGroupClass, _ImportService);
PHP_METHOD(SrvGroupClass, _ImportDynaService);
PHP_METHOD(SrvGroupClass, _CreateService);
PHP_METHOD(SrvGroupClass, _CreateServiceEx);
PHP_METHOD(SrvGroupClass, _LoadServiceEx);
PHP_METHOD(SrvGroupClass, _LoadServiceWithPath);
PHP_METHOD(SrvGroupClass, _LoadService);
PHP_METHOD(SrvGroupClass, _ClearService);
PHP_METHOD(SrvGroupClass, _ClearServiceEx);
PHP_METHOD(SrvGroupClass, _ClearLuaGlobal);
PHP_METHOD(SrvGroupClass, _ExportServiceHeader);
PHP_METHOD(SrvGroupClass, _ChangeDepend);
PHP_METHOD(SrvGroupClass, _AddDepend);

PHP_METHOD(SrvGroupClass, _XmlToService);
PHP_METHOD(SrvGroupClass, _XmlToServiceEx);

PHP_METHOD(SrvGroupClass, _Connect);
PHP_METHOD(SrvGroupClass, _ConnectEx);
PHP_METHOD(SrvGroupClass, _SConnect);
PHP_METHOD(SrvGroupClass, _SConnectEx);
PHP_METHOD(SrvGroupClass, _Connect2);
PHP_METHOD(SrvGroupClass, _ConnectEx2);
PHP_METHOD(SrvGroupClass, _DisConnect);
PHP_METHOD(SrvGroupClass, _IsConnect);





/*
{"_MessageBox", (PyCFunction)SRPSrvGroup_MessageBox, METH_VARARGS,""},
{"_PrintError", (PyCFunction)SRPSrvGroup_PrintError, METH_VARARGS,""},


{"_HyperLink", (PyCFunction)SRPSrvGroup_HyperLink, METH_VARARGS,""},
{"_AppEvent", (PyCFunction)SRPSrvGroup_AppEvent, METH_VARARGS,""},

{"_NewQueryRecord", (PyCFunction)SRPSrvGroup_NewQueryRecord, METH_VARARGS,""},
{"_NewParaPkg", (PyCFunction)SRPSrvGroup_NewParaPkg, METH_VARARGS,""},
{"_NewBinBuf", (PyCFunction)SRPSrvGroup_NewBinBuf, METH_VARARGS,""},
{"_NewSXml", (PyCFunction)SRPSrvGroup_NewSXml, METH_VARARGS,""},
{"_NewFunctionPara", (PyCFunction)SRPSrvGroup_NewFunctionPara, METH_VARARGS,""},
{"_NewCommInterface", (PyCFunction)SRPSrvGroup_NewCommInterface, METH_VARARGS,""},

{"_RunScript", (PyCFunction)SRPSrvGroup_RunLua, METH_VARARGS,""},
{"_RunScriptEx", (PyCFunction)SRPSrvGroup_RunLuaEx, METH_VARARGS,""},
{"_DoFile", (PyCFunction)SRPSrvGroup_DoFile, METH_VARARGS,""},
{"_RunPython", (PyCFunction)SRPSrvGroup_RunPython, METH_VARARGS,""},

{"_IsDefaultServer", (PyCFunction)SRPSrvGroup_IsDefaultServer, METH_VARARGS,""},
{"_IsWindowVisible", (PyCFunction)SRPSrvGroup_IsWindowVisible, METH_VARARGS,""},
{"_HideWindow", (PyCFunction)SRPSrvGroup_HideWindow, METH_VARARGS,""},
{"_ShowWindow", (PyCFunction)SRPSrvGroup_ShowWindow, METH_VARARGS,""},
{"_SetCaption", (PyCFunction)SRPSrvGroup_SetCaption, METH_VARARGS,""},
{"_ExitVSSystem", (PyCFunction)SRPSrvGroup_ExitVSSystem, METH_VARARGS,""},
{"_StartVSService", (PyCFunction)SRPSrvGroup_StartVSService, METH_VARARGS,""},
{"_IsAppActive", (PyCFunction)SRPSrvGroup_IsAppActive, METH_VARARGS,""},
{"_SetIdleActive", (PyCFunction)SRPSrvGroup_SetIdleActive, METH_VARARGS,""},
{"_GetVersion", (PyCFunction)SRPSrvGroup_GetVersion, METH_VARARGS,""},
{"_GetVersionInfo", (PyCFunction)SRPSrvGroup_GetVersionInfo, METH_VARARGS,""},
{"_SetColor", (PyCFunction)SRPSrvGroup_SetColor, METH_VARARGS,""},
{"_SetBkColor", (PyCFunction)SRPSrvGroup_SetBkColor, METH_VARARGS,""},
{"_SetClientBkColor ", (PyCFunction)SRPSrvGroup_SetClientBkColor , METH_VARARGS,""},
{"_ShowStatusMenu", (PyCFunction)SRPSrvGroup_ShowStatusMenu, METH_VARARGS,""},
{"_SetWindowStyle", (PyCFunction)SRPSrvGroup_SetWindowStyle, METH_VARARGS,""},
{"_MoveWindow", (PyCFunction)SRPSrvGroup_MoveWindow, METH_VARARGS,""},
{"_GetWindowPos", (PyCFunction)SRPSrvGroup_GetWindowPos, METH_VARARGS,""},
{"_SetWindowStatus", (PyCFunction)SRPSrvGroup_SetWindowStatus, METH_VARARGS,""},
{"_ClearClientWnd", (PyCFunction)SRPSrvGroup_ClearClientWnd, METH_VARARGS,""},
{"_HideClientWnd", (PyCFunction)SRPSrvGroup_HideClientWnd, METH_VARARGS,""},
{"_ShowClientWnd", (PyCFunction)SRPSrvGroup_ShowClientWnd, METH_VARARGS,""},
{"_SetClientSize", (PyCFunction)SRPSrvGroup_SetClientSize, METH_VARARGS,""},
{"_GetClientSize", (PyCFunction)SRPSrvGroup_GetClientSize, METH_VARARGS,""},
{"_MemorySize", (PyCFunction)SRPSrvGroup_MemorySize, METH_VARARGS,""},

{"_SetupSocketServer", (PyCFunction)SRPSrvGroup_SetupSocketServer, METH_VARARGS,""},
{"_SetupSocketClient", (PyCFunction)SRPSrvGroup_SetupSocketClient, METH_VARARGS,""},
{"_CloseSocketConnect", (PyCFunction)SRPSrvGroup_CloseSocketConnect, METH_VARARGS,""},
{"_SocketSend", (PyCFunction)SRPSrvGroup_SocketSend, METH_VARARGS,""},

{"_SetTimer", (PyCFunction)SRPSrvGroup_SetTimer, METH_VARARGS,""},
{"_KillTimer", (PyCFunction)SRPSrvGroup_KillTimer, METH_VARARGS,""},

{"_ProgramRestart", (PyCFunction)SRPSrvGroup_ProgramRestart, METH_VARARGS,""},

{"_HttpDownLoad", (PyCFunction)SRPSrvGroup_HttpDownLoad, METH_VARARGS,""},
{"_HttpDownLoadAbort", (PyCFunction)SRPSrvGroup_HttpDownLoadAbort, METH_VARARGS,""},
{"_RegWebDownFunction", (PyCFunction)SRPSrvGroup_RegWebDownFunction, METH_VARARGS,""},

{"_SetEnvCurrentUrl", (PyCFunction)SRPSrvGroup_SetEnvCurrentUrl, METH_VARARGS,""},
{"_RedirectToUrlRequest", (PyCFunction)SRPSrvGroup_RedirectToUrlRequest, METH_VARARGS,""},
{"_SetEnvPara", (PyCFunction)SRPSrvGroup_SetEnvPara, METH_VARARGS,""},
{"_RedirectToUrlAbort", (PyCFunction)SRPSrvGroup_RedirectToUrlAbort, METH_VARARGS,""},

{"_OpenLuaEdit", (PyCFunction)SRPSrvGroup_OpenLuaEdit, METH_VARARGS,""},
{"_LuaEditDisp", (PyCFunction)SRPSrvGroup_LuaEditDisp, METH_VARARGS,""},
{"_LuaEditHelp", (PyCFunction)SRPSrvGroup_LuaEditHelp, METH_VARARGS,""},
{"_CloseLuaEdit", (PyCFunction)SRPSrvGroup_CloseLuaEdit, METH_VARARGS,""},

{"_InsertSearchPath", (PyCFunction)SRPSrvGroup_InsertSearchPath, METH_VARARGS,""},
{"_ClearSearchPath", (PyCFunction)SRPSrvGroup_ClearSearchPath, METH_VARARGS,""},
{"_FirstSearchPath", (PyCFunction)SRPSrvGroup_FirstSearchPath, METH_VARARGS,""},
{"_ImportServiceEx", (PyCFunction)SRPSrvGroup_NextSearchPath, METH_VARARGS,""},

{"_GetSaveFile", (PyCFunction)SRPSrvGroup_GetSaveFile, METH_VARARGS,""},
{"_GetLoadFile", (PyCFunction)SRPSrvGroup_GetLoadFile, METH_VARARGS,""},

{"_FirstDoc", (PyCFunction)SRPSrvGroup_FirstDoc, METH_VARARGS,""},
{"_NextDoc", (PyCFunction)SRPSrvGroup_NextDoc, METH_VARARGS,""},
{"_RegisterDoc", (PyCFunction)SRPSrvGroup_RegisterDoc, METH_VARARGS,""},
{"_UnRegisterDoc", (PyCFunction)SRPSrvGroup_UnRegisterDoc, METH_VARARGS,""},


{"_GetStaticVersion", (PyCFunction)SRPSrvGroup_GetStaticVersion, METH_VARARGS,""},

{"_ToClipBoard", (PyCFunction)SRPSrvGroup_ToClipBoard, METH_VARARGS,""},
{"_FromClipBoard", (PyCFunction)SRPSrvGroup_FromClipBoard, METH_VARARGS,""},

{"_RunFromUrl", (PyCFunction)SRPSrvGroup_RunFromUrl, METH_VARARGS,""},

{"_SetClientPort", (PyCFunction)SRPSrvGroup_CreateClientSocket, METH_VARARGS,""},
{"_SetDebugPort", (PyCFunction)SRPSrvGroup_CreateDebugSocket, METH_VARARGS,""},
{"_SetTelnetPort", (PyCFunction)SRPSrvGroup_CreateTelnetSocket, METH_VARARGS,""},
{"_SetOutputPort", (PyCFunction)SRPSrvGroup_CreateOutputSocket},
{"_SetWebServerPort", (PyCFunction)SRPSrvGroup_CreateWebServerSocket, METH_VARARGS,""},

{"_RegisterServer", (PyCFunction)SRPSrvGroup_RegisterServer, METH_VARARGS,""},
{"_AllocCooperator", (PyCFunction)SRPSrvGroup_AllocCooperator, METH_VARARGS,""},
{"_FreeCooperator", (PyCFunction)SRPSrvGroup_FreeCooperator, METH_VARARGS,""},
{"_GetServerUrlInfo", (PyCFunction)SRPSrvGroup_GetServerInfo, METH_VARARGS,""},
{"_WebServiceRefresh", (PyCFunction)SRPSrvGroup_WebServiceRefresh, METH_VARARGS,""},
{"_GetWSDL", (PyCFunction)SRPSrvGroup_GetWSDL, METH_VARARGS,""},

{"_StringToUtf8", (PyCFunction)SRPSrvGroup_StringToUtf8, METH_VARARGS,""},
{"_Utf8ToString", (PyCFunction)SRPSrvGroup_Utf8ToString, METH_VARARGS,""},

{"_GetConfigEnvTag", (PyCFunction)SRPSrvGroup_GetConfigEnvTag, METH_VARARGS,""},
{"_GetConfigResult", (PyCFunction)SRPSrvGroup_GetConfigResult, METH_VARARGS,""},
{"_GetConfig", (PyCFunction)SRPSrvGroup_GetConfig, METH_VARARGS,""},
{"_GetConfigHost", (PyCFunction)SRPSrvGroup_GetConfigHost, METH_VARARGS,""},

{"_RegFileReqCallBack", (PyCFunction)SRPSrvGroup_RegFileReqCallBack, METH_VARARGS,""},
{"_UnRegFileReqCallBack", (PyCFunction)SRPSrvGroup_UnRegFileReqCallBack, METH_VARARGS,""},

{"_RegDispatchCallBack", (PyCFunction)SRPSrvGroup_RegDispatchCallBack, METH_VARARGS,""},

{"_LockLuaTable", (PyCFunction)SRPSrvGroup_LockLuaTable, METH_VARARGS,""},
{"_UnLockLuaTable", (PyCFunction)SRPSrvGroup_UnLockLuaTable, METH_VARARGS,""},
*/

/*---------------service class define------------------*/
PHP_METHOD(StarServiceClass, __construct);
PHP_METHOD(StarServiceClass, __destruct);
PHP_METHOD(StarServiceClass, __get);
PHP_METHOD(StarServiceClass, __set);
PHP_METHOD(StarServiceClass, __call);
PHP_METHOD(StarServiceClass, __toString);


#endif	/* PHP_STARCORE_H */


/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * End:
 * vim600: noet sw=4 ts=4 fdm=marker
 * vim<600: noet sw=4 ts=4
 */
